<template>
  <div>
    <el-card shadow="always" class="box-card">
      <div class="tableTitle"><span>基本信息</span></div>
      <div class="devTitle"><span>{{infoDetail.standardName}}</span></div>
      <div>
        <div class="tableStyle">
          <div class="labelS">标准编号</div>
          <div class="contentS">{{infoDetail.standardNum}}</div>
          <div class="labelS">标准名称</div>
          <div class="contentS">{{infoDetail.standardName}}</div>
        </div>
        <div class="tableStyle">
          <div class="labelS">所属部门</div>
          <div class="contentS">{{infoDetail.deptId}}</div>
          <div class="labelS">创建人</div>
          <div class="contentS">{{infoDetail.createBy}}</div>
        </div>
        <div class="tableStyle">
          <div class="labelS">创建时间</div>
          <div class="contentS">{{infoDetail.createTime}}</div>
          
        </div>
       <div class="tableStyle">
          <div class="labelS">标准说明</div>
          <div class="contentS">{{infoDetail.remark}}</div>
        </div>
      </div>
    </el-card>
    <!-- <el-card shadow="always" class="box-card">
      <div class="headerStyle"><span class="tableTitle">适用设备类别</span></div>
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column label="序号" type="index" width="50">
        </el-table-column>
        <el-table-column prop="name" label="类别名称"> </el-table-column>
      </el-table>
    </el-card> -->
    <el-card shadow="always" class="box-card">
      <div class="headerStyle"><span class="tableTitle">适用设备</span></div>
      <el-table :data="tableData2" border style="width: 100%">
        <el-table-column prop="deviceNum" label="设备编号"> </el-table-column>
        <el-table-column prop="deviceName" label="设备名称"> </el-table-column>
        <el-table-column prop="brandName" label="品牌"> </el-table-column>
        <el-table-column prop="category" label="类别" >
        </el-table-column>
        <el-table-column prop="specification" label="规格型号"> </el-table-column>
        <el-table-column prop="location" label="位置" >
        </el-table-column>
      </el-table>
      <div style="text-align:right;margin-top:20px;">
                <el-pagination
  background
  :pager-count="5"
  layout="total,prev, pager, next"
 small
 :page-size="pageSize"
 @current-change="handleCurrentChange"
 :current-page.sync="currentPage"
  :total="total">
</el-pagination>
            </div>
    </el-card>
    <el-card shadow="always" class="box-card">
      <div class="headerStyle"><span class="tableTitle">保养项目</span></div>
      <el-table :data="tableData" border style="width: 100%">
         <el-table-column prop="module" label="模块"> </el-table-column>
          <el-table-column prop="itemsNum" label="编号"> </el-table-column>
           <el-table-column prop="itemsName" label="项目"> </el-table-column>
            <el-table-column prop="maintainType" label="保养类型"> </el-table-column>
             <el-table-column prop="methodBenchmark" label="方法及基准"> </el-table-column>
           <el-table-column prop="type" label="类型"> </el-table-column>
           <el-table-column prop="lowerLimit" label="下线"> </el-table-column>
           <el-table-column prop="upperLimit" label="上线"> </el-table-column>
           <el-table-column prop="optional" label="可选项"> </el-table-column>
           <el-table-column prop="normalOption" label="正常选项"> </el-table-column>
           <el-table-column prop="remark" label="备注"> </el-table-column>

      </el-table>
      <div style="text-align:right;margin-top:20px;">
                <el-pagination
  background
  :pager-count="5"
  layout="total,prev, pager, next"
 small
 :page-size="project.pageSize"
 @current-change="handleChange"
 :current-page.sync="project.currentPage"
  :total="project.total">
</el-pagination>
            </div>
    </el-card>
  </div>
</template>
<script>
 import {getObj,getDevAuthList,getProjectList} from "@/api/ems/maintain/standard";
export default {
  data() {
    return {
      tableData: [],
      tableData2: [],
      
       id:"",
      infoDetail:{},
      currentPage: 1,
      total:0,
      pageSize:5,
     
      project:{
        currentPage: 1,
      total:0,
      pageSize:5,
      }
    };
  },
  mounted(){
    this.id = this.$route.query.id;
    this.getObjList();
    this.getDevAnuthPage();
    this.getProjectList();
  },
  methods:{
    getObjList(){
      getObj(this.id).then((res)=>{
        this.infoDetail = res.data.data
      })
    },
    getDevAnuthPage(){
      getDevAuthList({standardId:this.id ,size:this.pageSize,current:this.currentPage}).then((res)=>{
         this.tableData2 = res.data.data.records;
            this.total = res.data.data.total;
      })

    },
     handleCurrentChange(index){
        this.currentPage = index;
         this.getDevAnuthPage();
    },
    getProjectList(){
      getProjectList({standardId:this.id ,size:this.project.pageSize,current:this.project.currentPage}).then((res)=>{
         this.tableData = res.data.data.records;
            this.project.total = res.data.data.total;
      })
    },
    handleChange(index){
        this.project.currentPage = index;
         this.getProjectList();
    },
  }
};
</script>
<style lang="scss" scoped>
@import "@/styles/color.scss";
.headerStyle {
  margin-bottom: 20px;
}
.tableTitle {
  color: #333;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 20px;
}

.devTitle {
  color: #262626;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
}
.box-card {
  margin-bottom: 10px;
  .el-card__body {
    padding-top: 10px;
  }
  .labelS {
    //display: inline-block;
    flex: 0 0 150px;
    //height: 40px;
    // margin-right: 10px;
    text-align: left;
    color: #606266;
    padding: 10px;
    border: 1px solid rgba(236, 240, 244, 100);
    margin-bottom: -1px;
  }
  .contentS {
    border: 1px solid rgba(236, 240, 244, 100);
    // height: 40px;
    color: #606266;
    width: 100%;
    margin-left: -1px;
    margin-bottom: -1px;
    padding: 10px;
    // margin: 10px 0;
    // width: calc(100% - 120px);
    // display: inline-block;
  }
  .tableStyle {
    display: flex;
  }
  .number {
    font-weight: bold;
    margin-top: 5px;
    font-size: 16px;
  }
}
</style>
